/**
 * Created by rockyren on 14/11/18.
 */
describe('Unit: product路由测试',function(){
  beforeEach(module('productApp'));
  var $httpBackend;
  beforeEach(inject(function(_$httpBackend_){
    $httpBackend = _$httpBackend_;
  }));

  describe('CRUD product services',function(){
    var productService;
    beforeEach(inject(function(_productService_){
      productService = _productService_;
    }));
    var baseProductUrl = 'api/product';

    it('应该能请求商品首页信息',function(){
      $httpBackend.expectGET(baseProductUrl).respond(200);
      productService.get();
      $httpBackend.flush();
    });

    it('应该能请求特定的商品的具体信息',function(){
      $httpBackend.expectGET(baseProductUrl + '/2').respond(200);
      productService.show(2);

      $httpBackend.flush();
    });
  });


});